package demo;

import java.util.Date;

import com.aerospike.client.Bin;
import com.aerospike.client.IAerospikeClient;
import com.aerospike.client.Key;
import com.aerospike.client.Record;

public class LimitsTest {
	
	
	
	public static void main(String[] args) throws Exception {

		IAerospikeClient client = AsClientUtil.getClient();
		System.out.println("client="+client);
		
		String ns = "ns1";
		String setName = "123-_abc";
		
		// com.aerospike.client.AerospikeException: Error Code 4: Parameter error
		//  >= 64 个字符报错
		setName = "123456789_123456789_123456789_123456789_123456789_123456789_-abc";
		
		String key = "a";
		String binName = "1234567890abcde";
		
		//  com.aerospike.client.AerospikeException: Error Code 21: Bin name length greater than 14 characters or maximum bins exceeded
		// binName = "1234567890abcdef";
		Object value = System.currentTimeMillis()+"";
		
		value = System.currentTimeMillis();
		
		value = new Date()+"";
		
		Key k = new Key(ns,setName,key);
		Bin bin = new Bin(binName,value);
		
		client.put(null, k, bin);
		
		Record record = client.get(null, k);
		
		
		System.out.println(record);
		
		
		

	}
	
}
	